﻿<Window x:Class="OMS.Water.Sample.InstallerWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:localizer="clr-namespace:Systecs.Framework.WPF.Resources;assembly=Systecs.Framework.WPF"
        xmlns:Converter="clr-namespace:OMS.Water.Sample.Converter"
        Title="OMS.Water.Sample Bootstrapper and Installer"
        ResizeMode="NoResize"
        ShowInTaskbar="True"
        SizeToContent="WidthAndHeight">

	<Window.Resources>

		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Resources/ButtonGreen.xaml" />
				<ResourceDictionary Source="Resources/ButtonRed.xaml" />
			</ResourceDictionary.MergedDictionaries>

			<Style TargetType="Button"
			       x:Key="Button.DefaultStyle">
				<Setter Property="Margin"
				        Value="0,10,0,10" />
				<Setter Property="Padding"
				        Value="20,10,20,10" />
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="FontWeight" Value="SemiBold"/>
			</Style>

			<Style TargetType="Button"
			       BasedOn="{StaticResource Button.DefaultStyle}" />

			<Style TargetType="TextBlock">
				<Setter Property="TextBlock.FontSize"
				        Value="14" />
			</Style>

			<localizer:ImageToImageSourceConverter x:Key="ImageToImageSourceConverter" />
		</ResourceDictionary>


	</Window.Resources>
	<Grid Margin="10">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<Border Grid.Row="0"
		        BorderThickness="0,0,0,2"
		        BorderBrush="DarkGray"
		        Padding="0,0,0,10">
			<TextBlock Text="OMS.Water"
			           FontSize="36"
			           Background="#FF57622F"
			           HorizontalAlignment="Right"
			           Padding="10,0,10,0">
				<TextBlock.Foreground>
					<LinearGradientBrush EndPoint="0.5,1"
					                     StartPoint="0.5,0">
						<GradientStop Color="#FFB3E2E2"
						              Offset="0" />
						<GradientStop Color="#FF0D9393"
						              Offset="1" />
					</LinearGradientBrush>
				</TextBlock.Foreground>
			</TextBlock>
		</Border>

		<TextBlock Grid.Row="1"
		           Text="{localizer:Resx Key=OMS.Water.Title,FallbackValue='OMS.Water Title' }"
		           HorizontalAlignment="Center"
		           Margin="0,0,0,10"
		           FontSize="28"
		           FontWeight="Bold" />


		<ContentControl Grid.Row="2"
		                Content="{Binding Path=ActiveViewModel}"
		                ContentTemplateSelector="{Binding Path=DataTemplateSelector}" />

		<Border Grid.Row="3"
		        BorderThickness="0,0,0,2"
		        BorderBrush="DarkGray" 
                Margin="0,25,0,0"/>

		<StackPanel Grid.Row="4"
		            Orientation="Horizontal"
		            HorizontalAlignment="Center"
		            Margin="0,10,0,0">
			<StackPanel.Resources>
				<Style TargetType="Button"
				       x:Key="Button.Flag"
				       BasedOn="{StaticResource Button.DefaultStyle}">
					<Setter Property="Content">
						<Setter.Value>
							<TextBlock Text="My Button" />
						</Setter.Value>
					</Setter>
				</Style>
			</StackPanel.Resources>
			<Button Command="{Binding Path=SetUICulture}"
			        CommandParameter="en"
			        Padding="2,0,2,0"
			        Margin="5,0,5,0">
                <StackPanel Orientation="Horizontal">
                    <Image Source="{localizer:Resx Key=Image.Flag, Converter={StaticResource ImageToImageSourceConverter}, Culture={x:Static Converter:EnglishCultureProvider.Culture}}"
				           Width="32"
				           Height="32" />
                    <Label Content="{localizer:Resx Key=OMS.Water.Language, Culture=en, FallbackValue=English}" HorizontalAlignment="Center"/>
                </StackPanel>
			</Button>
			<Button Command="{Binding Path=SetUICulture}"
			        CommandParameter="de"
			        Padding="2,0,2,0"
			        Margin="5,0,5,0">
                <StackPanel Orientation="Horizontal">
                    <Image Source="{localizer:Resx Key=Image.Flag, Converter={StaticResource ImageToImageSourceConverter}, Culture=de }"
				       Width="32"
				       Height="32" />
                    <Label Content="{localizer:Resx Key=OMS.Water.Language, Culture=de, FallbackValue=Deutsch}" HorizontalAlignment="Center"/>
                </StackPanel>
            </Button>
		</StackPanel>
	</Grid>
</Window>